<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <textarea name="" id="" cols="30" rows="10"></textarea>
  <button>发布</button>
  <div></div>

  <script>
    const tx = document.querySelector('textarea')
    const div = document.querySelector('div')
    tx.nextElementSibling.addEventListener('click', function () {
      div.innerHTML = tx.value.replace(/激情|删除/g, '**')
      tx.value = ''
    })
  </script>
</body>

</html>